<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <style>

        .logTxtClass{
            width: 95%;
            background-color: #56eeac;
            height: 60%;
            overflow-y:auto;
            overflow-x:auto;
        }
    </style>

    <link rel="stylesheet" href="../bootstrap-3.4.1-dist/css/bootstrap.css" type="text/css">
    <link rel="stylesheet" href="../bootstrap-3.4.1-dist/css/bootstrap-theme.css" type="text/css">
</head>

<body>
    <h2>当前在线机器</h2>
    <td th:if="${ips.size()} eq 0">
        <div>无在线机器</div>
    </td>
    <ul th:each="t : ${ips}" class="list-group">
        <li class="list-group-item">
            <span class="label label-primary" th:text="${t}"></span>
            <a class=" btn btn-default glyphicon glyphicon-scissors" th:href="@{'/monitor?cmd=2&target=' + ${t}}">截屏</a>
            <a target="_blank" class=" btn btn-default glyphicon glyphicon-sunglasses" th:href="@{'/monitor?cmd=7&target=' + ${t}}">开启摄像头</a>
            <form action="/monitor" + ${t}}>
                <input type="hidden" name="cmd" value="3">
                <input type="hidden" name="target" th:value="${t}">
                <input type="text" name="str">
                <button class="btn btn-default glyphicon glyphicon-search" type="submit" >读取目录</button>
            </form>

            <form action="/monitor" + ${t}}>
                <input type="hidden" name="cmd" value="4">
                <input type="hidden" name="target" th:value="${t}">
                <input type="text" name="str">
                <button class="btn btn-default glyphicon glyphicon-download-alt" type="submit" >拷贝文件</button>
            </form>

            <form action="/monitor" + ${t}}>
                <input type="hidden" name="cmd" value="5">
                <input type="hidden" name="target" th:value="${t}">
                <input type="text" name="str">
                <button class="btn btn-default glyphicon glyphicon-off" type="submit" >执行进程</button>
            </form>

            <form action="/monitor" method="post" enctype="multipart/form-data">
                <input type="hidden" name="cmd" value="6">
                <input type="hidden" name="target" th:value="${t}">
                <input type="file" name="uploadFile" value="请选择文件">
                <input type="text" name="str">
                <button class="btn btn-default glyphicon glyphicon-open" type="submit">上传文件</button>

                <td th:if="${err} != null">
                <div class="alert alert-danger" role="alert" th:text="${err}"> </div>
                </td>
            </form>
        </li>
    </ul>
    <hr>

    <h2>操作</h2>
    <div style="font-size: 20px">
        <a class="btn btn-danger" href="/monitor?cmd=1">清空日志</a>
        <a class="btn btn-primary" href="/monitor?cmd=0">刷新日志</a>
        <a class="btn btn-info" href="/index.html">帮助文档</a>
    </div>

    <hr>

    <h2>日志</h2>
    <div class="logTxtClass" th:utext="${log}"></div>
</body>

